<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
	<xsl:param name="QueryString" />
	<xsl:template match="/*">
		<html>
		<head>
		<title><xsl:value-of select="ContentProperties/Title" /></title>

		<xsl:element name="meta">
			<xsl:attribute name="name">description</xsl:attribute>
			<xsl:attribute name="content"><xsl:value-of select="ContentProperties/Description" /></xsl:attribute>
		</xsl:element>		
		
		<xsl:element name="meta">
			<xsl:attribute name="name">keywords</xsl:attribute>
			<xsl:attribute name="content"><xsl:value-of select="ContentProperties/Keywords" /></xsl:attribute>
		</xsl:element>		
				
		<link rel="SHORTCUT ICON" href="http://www.michaelbraude.com/Images/MichaelBraude.ico" />

		<xsl:element name="link">
			<xsl:attribute name="rel">alternate</xsl:attribute>
			<xsl:attribute name="type">application/rss+xml</xsl:attribute>
			<xsl:attribute name="title"><xsl:value-of select="ContentProperties/Title" /></xsl:attribute>
			<xsl:attribute name="href"><xsl:value-of select="concat('http://www.michaelbraude.com/rss.php?', $QueryString)" /></xsl:attribute>
		</xsl:element>
		
		<style type="text/css">

		.Main {
			background: #01437B; 
			background-image: url('Images/Background-left.gif'); 
			background-repeat: repeat-y;
			font-size: small;
			font-face: 'Lucida Console'; 
			color: white;
			margin-top: 20px;
			margin-left: 40px;
		}
		
		.ContentTable {
			border: 2px solid white;  
			background: #6E6E6E;
			padding: 2px;			
		}
		
		.ContentCell {
			font-size: smaller;
		}
		
		.Code {
			font-size: smaller;
			font-face: 'Courier New';
			color: black;
			background-color: #E6D5AC;
			border: 1px dashed gray;
			padding: 2px;
		}
		
		a {
			color: white;
		}
			
		</style>

		<!-- Google Analytics stuff -->
      <script type="text/javascript">
        var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
        document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
      </script>
      <script type="text/javascript">
        var pageTracker = _gat._getTracker("UA-3781082-1");
        pageTracker._initData();
        pageTracker._trackPageview();
      </script>
		<script language="javascript">

function OnLoad() {

	if(navigator.userAgent.indexOf(".NET CLR 3.0") > -1) {
		document.getElementById("xamlLinkSpan").style.display = "block";
	}

}
		
		</script>
		
		</head>
		<body class="Main" onload="OnLoad()">
		
			<table cellpadding="0" cellspacing="0" style="width: 731px;">
				<tr valign="top">
					<td style="width: 731px;" colspan="2">
						<table cellpadding="0" cellspacing="0" style="width: 731px;">
							<tr valign="middle">
								<td style="width: 154px;">
									<img src="Images/Face2.gif" width="160" height="160" alt="Michael Braude" />
								</td>
								<td style="width: 577px; padding-left: 30px;">
									<a href="http://michaelbraude.com"><img src="Images/Banner.gif" width="577" height="61" alt="www.michaelbraude.com" style="border-style: none;" /></a>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr valign="top">
					<td style="width: 731px; padding-top: 10px;">
						<table cellpadding="0" cellspacing="0">
							<tr valign="top">
								<td style="width: 160px;">
									<table cellpadding="0" cellspacing="0">
										<tr valign="top">
											<td>
												<xsl:text disable-output-escaping="yes"><![CDATA[&nbsp;]]></xsl:text>
											</td>
										</tr>
										<tr valign="top">
											<td class="ContentTable" style="width: 160px; font-size: smaller">
												<a href="index.php">Home</a><br />
												<a href="index.php?XML/Biography.xml">BIO</a><br />												
												<a href="index.php?XML/Resume.xml">Resume</a><br />
												<a href="index.php?XML/Projects/Index.xml">Projects</a><br />
                                                <a href="index.php?XML/Articles/Index.xml">Articles</a><br />
												<a href="index.php?XML/Blog/Index.xml">Blog</a><br />
												<a href="index.php?XML/TechnicalBlog/Index.xml">Tech Blog</a><br />
												<div  id="xamlLinkSpan" style="display: none;">
													<xsl:element name="a">
														<xsl:attribute name="href">
														<xsl:value-of select="concat('http://www.michaelbraude.com/indexXAML.php?', $QueryString)" />
														</xsl:attribute>
														<xsl:value-of select="'XAML Version'" />
													</xsl:element>
												</div>
											</td>
										</tr>										
										<tr valign="top">
											<td align="left" style="padding-top: 10px; padding-left: 2px;">
												<xsl:element name="a">
													<xsl:attribute name="href">
														<xsl:value-of select="concat('http://www.michaelbraude.com/rss.php?', $QueryString)" />
													</xsl:attribute>
													<img src="Images/RSS.gif" alt="Subscribe to an RSS feed for this page" width="36" height="17" border="0" />
												</xsl:element>
											</td>										
										</tr>
                    <tr valign="top">
                      <td align="left"
                          style="width: 154px; padding-top: 10px;">
                        <script type="text/javascript">
                          <xsl:text><![CDATA[<!--
google_ad_client = "pub-0156561020926043";
/* Menu Ad */
google_ad_slot = "9119835418";
google_ad_width = 160;
google_ad_height = 600;
//-->]]></xsl:text>
                        </script>
                        <script type="text/javascript"
                                src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
                        </script>
                      </td>
                    </tr>
									</table>
								</td>
								<!-- Content Goes Here -->
								<td style="width: 577px; padding-left: 30px;">
									<table cellpadding="0" cellspacing="0">
										<xsl:apply-templates select="Sections" />
                    <tr valign="top">
                      <td style="width: 577px;">
                        <table cellpadding="0"
                               cellspacing="0"
                               style="width: 577px;">
                          <tr valign="top">
                            <td style="width: 75%; text-align: center;" colspan="2">
                              &#169; Copyright 2008 <a href="mailto:mikebraude@gmail.com">Michael Braude</a>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</body>
		</html>
	</xsl:template>
	
	<!-- This section handles the content elements -->
	<xsl:template match="Section">
		<tr valign="top">
			<td style="width: 577px;">
				<table cellpadding="0" cellspacing="0" style="width: 577px;">
					<tr valign="top">
						<td style="width: 75%; text-align: left;">
							<xsl:element name="a">							
								<xsl:attribute name="name">
									<xsl:value-of select="translate(@Title, ' ', '')" />
								</xsl:attribute>
								<xsl:value-of select="@Title" />
							</xsl:element>
						</td>
						<td style="width: 25%; text-align: right;">
							<xsl:value-of select="@LastModified" />
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr valign="top">
			<td style="width: 577px;">
				<table cellpadding="0" cellspacing="0" class="ContentTable">
					<tr valign="top">
						<td style="width: 577px;" class="ContentCell">
							<xsl:apply-templates/>
						</td>
					</tr>          
				</table>
			</td>
		</tr>
		<tr valign="top">
			<td style="width: 577px; height: 10px;">
				
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="Bold">
		<b><xsl:apply-templates/></b>
	</xsl:template>
	<xsl:template match="Newline">
		<br />
	</xsl:template>
	<xsl:template match="NewParagraph">
		<br />
		<br />
	</xsl:template>
	<xsl:template match="List">
		<ul>
			<xsl:apply-templates />
		</ul>
	</xsl:template>
	<xsl:template match="ListElement">
		<li>
			<xsl:apply-templates />
		</li>
	</xsl:template>
	<xsl:template match="ContentLink">		
		<xsl:element name="a">
			<xsl:attribute name="href">
				<xsl:value-of select="'index.php?XML/'" />
				<xsl:value-of select="@href" />
			</xsl:attribute>
			<xsl:apply-templates />
		</xsl:element>
	</xsl:template>
	<xsl:template match="ExternalLink">
		<xsl:element name="a">
			<xsl:attribute name="class">Link</xsl:attribute>
			<xsl:attribute name="href">
				<xsl:value-of select="@href" />
			</xsl:attribute>
			<xsl:apply-templates />
		</xsl:element>
	</xsl:template>
	<xsl:template match="Table">		
		<table cellpadding="0" cellspacing="0" style="width: 100%;">
			<tr valign="top">
				<xsl:apply-templates />
			</tr>					
		</table>
	</xsl:template>
	<xsl:template match="TableRow">
		<tr valign="top">
			<xsl:apply-templates />
		</tr>
	</xsl:template>
	<xsl:template match="TableCell">
		<xsl:element name="td">
			<xsl:attribute name="style">
				<xsl:value-of select="'width: '" />
				<xsl:value-of select="@WidthPercent" />
				<xsl:value-of select="'%;'" />
			</xsl:attribute>
			<xsl:attribute name="class">
				<xsl:value-of select="'ContentCell'" />
			</xsl:attribute>
			<xsl:apply-templates />
		</xsl:element>
	</xsl:template>
	<xsl:template match="Code">		
		<br/>
		<br/>
		<table cellpadding="0" cellspacing="0" style="width: 100%;">
			<tr valign="top">
				<td style="width: 100%" class="ContentCell">
					<pre class="Code">
						<xsl:apply-templates />
					</pre>
				</td>
			</tr>					
		</table>
	</xsl:template>
	<xsl:template match="Image">
		<table cellpadding="0" cellspacing="0" style="width: 100%; padding-top: 10px; padding-bottom: 10px;">
			<tr valign="top">
				<td align="center">
					<xsl:element name="img">
						<xsl:attribute name="src"><xsl:value-of select="@href" /></xsl:attribute>
						<xsl:attribute name="width"><xsl:value-of select="@width" /></xsl:attribute>
						<xsl:attribute name="height"><xsl:value-of select="@height" /></xsl:attribute>
					</xsl:element>
				</td>
			</tr>
		</table>
	</xsl:template>	
</xsl:stylesheet>
